package util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class CmdParser {
	public static String[] parseCmd(String cmd){
		String[] strings = null;
//		String re = "^[CL]\\s+\\w{3,4}\\s+\\w{2,5}$";
		String re ="(^L\\s+(xml|line)\\s+(id|birth)$)|(^C\\s+xml\\s+(id|birth)$)";
		Pattern pattern = Pattern.compile(re);
		Matcher matcher = pattern.matcher(cmd);
		if(matcher.find()){
			strings = cmd.split("\\s+");
		}
//		for(String string:strings){
//			System.out.println(string);
//		}
		return strings;
	}
}
